﻿@using Page = ClassyBlog.DomainObjects.Page
@{
    var blog = Model.Blog as Blog;
    var page = Model.Item as Page;

    this.SetViewPropertiesFrom(page);

    var disqus = blog.Disqus as string;
    var showComments = page.AllowComments && !string.IsNullOrWhiteSpace(disqus);
}
<article role="article">
    <header>
        <h1>@page.Title</h1>
    </header>
    <div>
        @Html.Raw(Renderer.RenderFull(page))
    </div>
    <footer role="contentinfo">
        This page was published on <time datetime="@page.PublishedAt.ShortFormat()" pubdate="pubdate">@page.PublishedAt.LongFormat()</time>
        by @(page.Author ?? blog.Author).
        @if (showComments) {
            <text> You can skip to the end and</text> <a href="#dsq-form-area">leave your comment</a>.
        }
    </footer>
    @if (showComments) {
        @Html.Partial("_CommentList", disqus)
    }
</article>